function checkTextField(field) {
	if (field.value == '') {
		var el = document.getElementById("praznaPolja");
		el.style.visibility="visible";
		
		var elColor = document.getElementById(field.id+"P");
		elColor.style.color="red";
		
		var button = document.getElementById("Dodaj");
		button.disabled = true;
	} else {
		var elColor = document.getElementById(field.id+"P");
		elColor.style.color="black";
		var el = document.getElementById("praznaPolja");
		if(checkAll()){
			el.style.visibility="hidden";
		}
	}
	    
	function checkAll(){
		var inputs = document.getElementsByTagName('input');
		var boll = true;

		for (var i = 0; i < inputs.length; i += 1) {
			if(inputs[i].value == ''){
				var el = document.getElementById("praznaPolja");
				el.style.visibility="visible";
	    	        
				boll = false;
			}
		};
		return boll;
	}
}